<?php
/**
 * 我的订单主控器
 * Author: 孙武 QQ:1228746736
 * Date: 2017/11/2
 * Time: 9:27
 */
namespace Home\Controller;

use Home\Model\MyTicketModel;

class MyTicketController extends \Home\Controller\HomeController{

    private $_M;


    public function __construct()
    {
        parent::__construct();
        $this->_M=new MyTicketModel('order');
    }

    /**
     * 获取未付款的订单
     */
    public function getHadNoPayTicket()
    {
        $dbData = $this->_M->getHadNoPay();
        if (C('HOME_DEBUG')) {
            echo "";
            dump($dbData);
        }
        $this->assign("ticketInfo",$dbData);
        $this->assign("on1","weui-bar__item_on");
        $this->display();
//        dump($dbData);
    }



    /**
     * 获取预约中的订单
     */
    public function getOrdingTicket()
    {
        $dbData=$this->_M->getOrdering();
        if (C('HOME_DEBUG')) {
            dump($dbData);
        }
        $this->assign("ticketInfo",$dbData);
        $this->assign("on2","weui-bar__item_on");
        $this->display();
    }

    /**
     * 获取已支付的订单
     */
    public function getHadPayTicket()
    {
        $dbData=$this->_M->getHadPay();
        if (C('HOME_DEBUG')) {
            dump($dbData);
        }
        $this->assign("ticketInfo",$dbData);
        $this->assign("on3","weui-bar__item_on");
        $this->display();
    }

    /**
     * 获取已取消的订单
     */
    public function getHadCanelTicket()
    {
        $dbData=$this->_M->getHadCancel();
        if (C('HOME_DEBUG')) {
            dump($dbData);
        }
        $this->assign("ticketInfo",$dbData);
        $this->assign("on4","weui-bar__item_on");
        $this->display();
    }
}